﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

//main86：指针实现字符串拷贝
int main86()
{
	char src[100] = "hello";
	char dst[100]; //把src的内容拷贝给dst

	char* p = src;
	//int index = 0;
	char* pDst = dst;
	while (*p != '\0')
	{
		printf("1.输出源字符串src的每个字符：%c\n", *p);//h e l l o
		//dst[index] = *p;
		*pDst = *p;
		p++;
		//index++;
		pDst++;
	}
	//dst[index] = '\0';
	*pDst = '\0';
	printf("2.输出目标字符串dst的值：%s\n", dst);//hello

	system("pause");
	return EXIT_SUCCESS;
}